package com.lmx.api.service.impl.inneriml;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lmx.api.service.InterfanceInfoService;
import com.lmx.commen.model.entity.InterfanceInfo;
import com.lmx.commen.model.entity.UserInterfanceInfo;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * @author lmx
 * @description 针对表【interfance_info(接口信息表)】的数据库操作Service
 * @createDate 2023-02-02 13:08:22
 */
@DubboService
public class InnerInterfanceInfoServiceImpl implements com.lmx.commen.service.InnerInterfanceInfoService {

    @Resource
    private InterfanceInfoService interfanceInfoService;

    @Override
    public InterfanceInfo getInterfanceInfoByUrlOrMethod(String url, String method) {
        /**
        * 不考虑restful风格的代码，类路径的
         * */
        if (url != null && method != null) {
            LambdaQueryWrapper<InterfanceInfo> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(InterfanceInfo::getUrl, url).eq(InterfanceInfo::getMethod, method);
            return interfanceInfoService.getOne(queryWrapper);

        }
        return null;
    }

}
